﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GeoWeb.Common;

namespace GeoWeb.Demo.Commons
{
    public partial class GeoHttpHelper_Demo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            funGeoHttpHelper();
        }

        #region GeoGeoHttpHelper
        private void funGeoHttpHelper()
        {
            //http get
            Uri uri = new Uri("http://www.google.co.uk");
            HttpHelper httper = new HttpHelper(uri);
            string response = httper.Get();

            //http post
            Uri uri1 = new Uri("http://www.baidu.com/s");
            HttpHelper httper1 = new HttpHelper(uri1);
            string search_query = "word";
            string postData = "word=" + search_query;

            //string response1 = httper1.Post(postData);

            //http 下载到本地
            Uri uri2 = new Uri("http://10.3.1.220/update/updateapp/ReleaseList.xml");
            HttpHelper httper2 = new HttpHelper(uri1);
            httper2.DownloadFile(uri2, @"d:\ReleaseList.xml");

        }
        #endregion
        
    }
}